package com.walsai.pcsys.web.controller;


import org.springframework.web.servlet.mvc.SimpleFormController;


import com.walsai.pcsys.core.model.User;
import com.walsai.pcsys.core.service.UserManager;


public class SignupController extends SimpleFormController{

	private UserManager userManager;
	
	public void setUserManager(UserManager userManager){
		this.userManager = userManager;
	}
	
	protected void doSubmitAction(Object o) throws Exception {
		User anonymous = (User) o;
		anonymous.setRole(User.ROLE_USER);
		this.userManager.save(anonymous);
	}
}
